Platform Explorer / Nuxeo Platform 2023.14

Operation Document.AddItemToListProperty (Adds an Entry Into a Multivalued Complex Property)

Description

This operation can add new entries to a multivalued complex property. The xpath parameter is the property that should be updated (e.g.: contract:customers). The value parameter is a String containing the JSON-formatted list of entries to add. E.g.: assuming a Contract document type holding customers, each having a firstName and lastName property: [{"lastName":"Norris", "firstName": "Chuck"}, {"lastName":"Lee", "firstName": "Bruce"}] . Activating the save parameter forces the changes to be written in database immediately (at the cost of performance loss), otherwise changes made to the document will be written in bulk when the chain succeeds.

Save parameter has to be turned off when this operation is used in the context of the empty document created, about to create, before document modification, document modified events.

Operation id Document.AddItemToListProperty
AliasesDocument.AddItemToListProperty
Category Document
Label Adds an Entry Into a Multivalued Complex Property
Requires
Since

Parameters

Name Description Type Required Default value
complexJsonProperties string yes  
xpath string yes  
save boolean no true 

Signature

Inputs document, documents
Outputs document, documents

Implementation Information

Implementation Class Class: org.nuxeo.ecm.automation.core.operations.document.AddItemToListProperty
Contributing Component org.nuxeo.ecm.core.automation.coreContrib

JSON Definition

{
  "id" : "Document.AddItemToListProperty",
  "aliases" : [ "Document.AddItemToListProperty" ],
  "label" : "Adds an Entry Into a Multivalued Complex Property",
  "category" : "Document",
  "requires" : null,
  "description" : "This operation can add new entries to a multivalued complex property. The xpath parameter is the property that should be updated (e.g.: contract:customers). The value parameter is a String containing the JSON-formatted list of entries to add. E.g.: assuming a Contract document type holding customers, each having a firstName and lastName property: [{\"lastName\":\"Norris\", \"firstName\": \"Chuck\"}, {\"lastName\":\"Lee\", \"firstName\": \"Bruce\"}] . Activating the save parameter forces the changes to be written in database immediately (at the cost of performance loss), otherwise changes made to the document will be written in bulk when the chain succeeds. <p>Save parameter has to be turned off when this operation is used in the context of the empty document created, about to create, before document modification, document modified events.</p>",
  "url" : "Document.AddItemToListProperty",
  "signature" : [ "document", "document", "documents", "documents" ],
  "params" : [ {
    "name" : "complexJsonProperties",
    "description" : null,
    "type" : "string",
    "required" : true,
    "widget" : null,
    "order" : 0,
    "values" : [ ]
  }, {
    "name" : "xpath",
    "description" : null,
    "type" : "string",
    "required" : true,
    "widget" : null,
    "order" : 0,
    "values" : [ ]
  }, {
    "name" : "save",
    "description" : null,
    "type" : "boolean",
    "required" : false,
    "widget" : null,
    "order" : 0,
    "values" : [ "true" ]
  } ]
}